<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>类型列表</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- 引入 Bootstrap -->
    <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>

<div class="container">
    <div class="row clearfix">
        <div class="col-md-12 column">
            <div class="page-header">
                <h1>
                    <small>类型列表</small>
                </h1>
                <a style="float: right" href="${pageContext.request.contextPath}/login/exportTypeInfo">导出excel表</a>
            </div>
        </div>
    </div>

    <div class="row">
        <div class="col-md-4 column"  >
            <a class="btn btn-primary"  href="${pageContext.request.contextPath}/login/toAddTypeInfo">添加类型</a>
        </div>
        <div style="display: inline">
            <div style="display: inline-block">
                <form action="${pageContext.request.contextPath}/login/searchTypeInfo" method="GET" >
                   类型名称： <input type="text" name="keyTypeName">
                    <input type="submit" value="搜索">
                </form>
            </div>
        </div>
    </div>

    <div class="row clearfix">
        <div class="col-md-12 column">
            <table class="table table-hover table-striped">
                <thead>
                <tr>
                    <th>ID</th>
                    <th>类型名称</th>
                    <th>备注</th>
                    <th>操作</th>
                </tr>
                </thead>

                <tbody>
                <c:forEach var="typeinfo" items="${pageInfo.list}">
                    <tr>
                        <td>${typeinfo.id}</td>
                        <td>${typeinfo.typeName}</td>
                        <td>${typeinfo.remarks}</td>
                        <td>
                            <a href="${pageContext.request.contextPath}/login/toUpdateTypeInfo?id=${typeinfo.getId()}">更改</a>
                            |
                            <a href="${pageContext.request.contextPath}/login/delTypeInfo/${typeinfo.getId()}">删除</a>
                        </td>

                    </tr>
                </c:forEach>
                </tbody>
            </table>
        </div>
        <div class="box-tools pull-right">
            <ul class="pagination">
                <li><a href="${pageContext.request.contextPath}/typeIndex?page=1&size=5"
                       aria-label="Previous">首页</a></li>
                <li>
                    <a href="${pageContext.request.contextPath}/typeIndex?page=${pageInfo.pageNum-1}&size=5">上一页</a>
                </li>
                <c:forEach begin="1" end="${pageInfo.pages}" var="pageNum">
                    <li>
                        <a href="${pageContext.request.contextPath}/typeIndex?page=${pageNum}&size=5">${pageNum}</a>
                    </li>
                </c:forEach>
                <li>
                    <a href="${pageContext.request.contextPath}/typeIndex?page=${pageInfo.pageNum+1}&size=5">下一页</a>
                </li>
                <li><a href="${pageContext.request.contextPath}/typeIndex?page=${pageInfo.pages}&size=5"
                       aria-label="Next">尾页</a></li>
            </ul>
        </div>
    </div>
</div>